/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kasgroup2;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author beha
 */
@Entity
@Table(name = "kas_companion_activities", catalog = "db2", schema = "")
@NamedQueries({
    @NamedQuery(name = "KasCompanionActivities.findAll", query = "SELECT k FROM KasCompanionActivities k"),
    @NamedQuery(name = "KasCompanionActivities.findById", query = "SELECT k FROM KasCompanionActivities k WHERE k.id = :id"),
    @NamedQuery(name = "KasCompanionActivities.findByName", query = "SELECT k FROM KasCompanionActivities k WHERE k.name = :name"),
    @NamedQuery(name = "KasCompanionActivities.findByPlace", query = "SELECT k FROM KasCompanionActivities k WHERE k.place = :place"),
    @NamedQuery(name = "KasCompanionActivities.findByStart", query = "SELECT k FROM KasCompanionActivities k WHERE k.start = :start"),
    @NamedQuery(name = "KasCompanionActivities.findByEnd", query = "SELECT k FROM KasCompanionActivities k WHERE k.end = :end"),
    @NamedQuery(name = "KasCompanionActivities.findByPrice", query = "SELECT k FROM KasCompanionActivities k WHERE k.price = :price"),
    @NamedQuery(name = "KasCompanionActivities.findByComment", query = "SELECT k FROM KasCompanionActivities k WHERE k.comment = :comment")})
public class KasCompanionActivities implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "name")
    private String name;
    @Column(name = "place")
    private String place;
    @Column(name = "start")
    @Temporal(TemporalType.TIMESTAMP)
    private Date start;
    @Column(name = "end")
    @Temporal(TemporalType.TIMESTAMP)
    private Date end;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "price")
    private Double price;
    @Column(name = "comment")
    private String comment;

    public KasCompanionActivities() {
    }

    public KasCompanionActivities(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        String oldName = this.name;
        this.name = name;
        changeSupport.firePropertyChange("name", oldName, name);
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        String oldPlace = this.place;
        this.place = place;
        changeSupport.firePropertyChange("place", oldPlace, place);
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        Date oldStart = this.start;
        this.start = start;
        changeSupport.firePropertyChange("start", oldStart, start);
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        Date oldEnd = this.end;
        this.end = end;
        changeSupport.firePropertyChange("end", oldEnd, end);
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        Double oldPrice = this.price;
        this.price = price;
        changeSupport.firePropertyChange("price", oldPrice, price);
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        String oldComment = this.comment;
        this.comment = comment;
        changeSupport.firePropertyChange("comment", oldComment, comment);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KasCompanionActivities)) {
            return false;
        }
        KasCompanionActivities other = (KasCompanionActivities) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "kasgroup2.KasCompanionActivities[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
